package com.example.finalwork.service;


import com.example.finalwork.model.Paper;
import com.example.finalwork.repository.PaperRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PaperService {
    @Autowired
    private PaperRepository paperRepository;
    public List<Paper> findAll() {
        return paperRepository.findAll();
    }
    public void deletePaper(Long id){
        paperRepository.deleteById(id);
    }
    public Paper addPaper(Paper paper){
        return paperRepository.save(paper);
    }

}

